package com.tcredit.spider.web.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.tcredit.spider.web.model.User;

@Mapper
public interface UserDao {

	@Select("select id, name from user")
	List<User> getAllList();

	@Insert("insert into user(name) values(#{name})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	int add(User user);
	
	@Update("update user set name='roll-back' where id=#{id} ")
	int update(@Param(value="id")int id);

}
